package com.liu.project.pojo;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

/**
 * @program: project
 * @description:
 * @author: 86187
 * @create: 2022-03-06 15:52
 **/
@JsonIgnoreProperties(ignoreUnknown = true)
public final class SysRole implements GrantedAuthority {

    private  String role;


    public String getRole() {
        return role;
    }

   public SysRole(){

   }

    public SysRole(String role ) {
        this.role = role;

    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        } else {
            return obj instanceof SimpleGrantedAuthority ? this.role.equals(((SysRole) obj).role) : false;
        }
    }

    public int hashCode() {
        return this.role.hashCode();
    }

    public String toString() {
        return this.role;
    }

    @Override
    public String getAuthority() {
        return this.role;
    }
}
